import { deleted, get, post, put } from "@/api/client";

/**
 *
 * 分页查询
 * page
 * size
 * @param params
 * @returns {*}
 */
export function getAnnouncePage(params) {
	return get("/announce", params);
}

/**
 * 获取公告
 * @param id
 * @returns {*}
 */
export function getAnnounceById(id) {
	return get(`/announce/${id}`);
}

/**
 * 修改公告信息
 * @param announce
 * @returns {*}
 */
export function updateAnnounce(announce) {
	return put("/announce", announce);
}

/**
 * 删除公告
 * @param id
 */
export function deletedAnnounce(id) {
	return deleted("/announce", { id });
}

/**
 * 保存公告
 * @param announce
 * @returns {*}
 */
export function saveAnnounce(announce) {
	return post("/announce", announce);
}
